#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[]) {
    int a, b;
    int maxv, minv;
    int gcd, lcm; 
    scanf("%d%d", &a, &b);
    if (a > b) {
        maxv = a;
        minv = b;
    }
    else {
        maxv = b;
        minv = a;
    }
    gcd = minv;
    int temp = 1;
    while (minv != 0) {
        temp = minv;
        minv = maxv % minv;

        maxv = temp;
    }
    gcd = maxv;
    lcm = maxv;
    lcm = (a * b) / gcd;
    printf("%d %d", gcd, lcm);

    return 0;
}
